package test_junit_shop;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import util.BaseDriver;

import java.util.List;


/**
 * Created by CYH on 2018/2/05.
 * 门店-销售收银-商品销售-财务退款单-支付
 */

public class FinancialRefundSheet extends BaseDriver{

    private static FinancialRefundSheet instance=new FinancialRefundSheet();
    private FinancialRefundSheet(){}

    public static FinancialRefundSheet getInstance(){
        return instance;
    }

    public void pay() throws InterruptedException {
        Thread.sleep(10000);
        List<WebElement> frameList = driver.findElements(By.xpath("//iframe[@name='iframeundefined']"));
        driver.switchTo().frame(frameList.get(frameList.size() - 1));

        driver.findElement(By.xpath("(//input[@name='btSelectItem'])[1]")).click();
        driver.findElement(By.xpath("(//button[@type='button'])[2]")).click();

        Thread.sleep(2000);
        driver=driver.switchTo().frame(0);

        driver.findElement(By.id("sub")).click();
        Thread.sleep(2000);

        driver.findElement(By.linkText("确定")).click();
    }



}
